package com.clinic.action.common;

import com.clinic.entity.param.SessionUser;
import com.clinic.entity.type.UserType;

public class AuthenticationAction extends AbstractAction {

	private static final long serialVersionUID = -4089906378836346759L;
	
	public boolean isDoctorLogin() {
		SessionUser sessionUser =  getLoginUser();
		return (sessionUser.isAvailable() && sessionUser.getType() == UserType.DOCTOR);
	}
	
	public boolean isPatientLogin() {
		SessionUser sessionUser =  getLoginUser();
		return (sessionUser.isAvailable() && sessionUser.getType() == UserType.PATIENT);
	}
	
	public boolean isAssistantLogin() {
		SessionUser sessionUser =  getLoginUser();
		return (sessionUser.isAvailable() && sessionUser.getType() == UserType.ASSISTANT);
	}

}
